import { Button } from "antd";
import ThemeContext from "@/utils/ThemeContext";
import { useContext } from "react";

export default function Footer({ handleOppose, oppose }: { handleOppose: () => void, oppose: number }) {
	let { handleCount, count } = useContext(ThemeContext);
	return (
		<div className="footer-component">
			<span>子组件Footer</span>
			<span>反对人数：{oppose}</span>
			<Button onClick={handleOppose}>点我调用父组件方法反对</Button>
			<div>
				<div>以下为useContext</div>
				<span>支持人数：{count}</span>
				<Button onClick={handleCount}>useContext支持</Button>
			</div>
		</div>
	);
}
